package com.hundred.home.module.screen;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.turbine.Context;
import com.alibaba.citrus.turbine.Navigator;
import com.alibaba.citrus.util.StringUtil;
import com.hundred.item.dao.dataobject.AppItemDO;
import com.hundred.item.manager.AppItemManager;

public class AppIndex {

	private static final Logger logger = LoggerFactory.getLogger(AppIndex.class);

	@Autowired
    private HttpServletRequest request;
	@Autowired
	private AppItemManager itemManager;


	public void execute(Context context, Navigator nav) {
		
		String tagStr = request.getParameter("tag");
		int tag = 100;
		if(!StringUtil.isBlank(tagStr)){
			tag=Integer.parseInt(tagStr);
		}
		List<AppItemDO> resultList = itemManager.getAppItemList(tag);
		
		
		
		context.put("resultList", resultList);
	}


	public AppItemManager getItemManager() {
		return itemManager;
	}


	public void setItemManager(AppItemManager itemManager) {
		this.itemManager = itemManager;
	}
	
	

}
